home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_anubisarm.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  104 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_AnubisArm.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15.  
  16. cog            talkCog                    local
  17.  
  18. keyframe    get=in_pickup_low.key    local
  19.  
  20. sound        foundSnd=INXJ253.wav    local
  21.  
  22. thing        player                    local
  23. thing        item=-1                    local
  24.  
  25. int            bin=52                    local
  26.  
  27. end
  28.  
  29. # ===================================================================
  30.  
  31. code
  32.  
  33. activated:
  34.  
  35.     player = GetSourceRef();
  36.     item = GetSenderRef();
  37.  
  38.     # See if player is holding something. 
  39.     if (GetCurItem(player) != 0)
  40.     {
  41.         return;
  42.     }
  43.  
  44.     # Disable player controls and stuff
  45.     if (MakeMeStop() == -1)
  46.         return;
  47.     DeselectWeaponWait(player);
  48.  
  49.     if (GetInv(player, bin) < GetInvMax(player, bin))
  50.     {
  51.         StartCutscene(0);
  52.         CaptureThing(player);
  53.         PlayKey(player, get, 5, 0x12, 0); 
  54.     }
  55.     else
  56.     {
  57.         ClearActorFlags(player, 0x200000);
  58.         return;
  59.     }
  60.  
  61.     talkCog = GetCogByIndex(0);
  62.     SendMessage(talkCog, 27);
  63.  
  64.     if (Rand() < 0.5)
  65.     {
  66.         SetExtCamOffset('0.15 -0.05 0.04');
  67.     }
  68.     else
  69.     {
  70.         SetExtCamOffset('-0.15 -0.05 0.04');
  71.     }
  72.  
  73.     SetExtCamLookOffset('0.0 0.02 0.0');
  74.  
  75.     return;
  76.  
  77. # -------------------------------------------------------------------
  78.  
  79. callback:
  80.  
  81.     ReleaseThing(player);
  82.  
  83.     if (item != -1)
  84.     {
  85.         DestroyThing(item);
  86.         item = -1;
  87.     }
  88.  
  89.     ChangeInv(player, bin, 1.0);
  90.     SetInvAvailable(player, bin, 1);
  91.     JonesInvItemChanged(bin);
  92.  
  93.     RestoreExtCam();
  94.  
  95.     Sleep(1.0);
  96.     PlayVoice(player, foundSnd, 1.0, 0);
  97.  
  98.     ClearActorFlags(player, 0x200000);
  99.     EndCutscene();
  100.  
  101.     return;
  102.  
  103. end
  104.